package com.service.impl;


import com.domain.Account;
import com.domain.User;
import com.mapper.AccountMapper;
import com.service.AccountService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("accountService")
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountMapper accountMapper;




    @Override
    public List<User> checkUser(String username, String password) {
        return accountMapper.checkUser(username, password);
    }

    //查询所有用户
    @Override
    public List<User> findUsers() {
        return accountMapper.findUsers();
    }

    @Override
    public void signUp(String username, String password) {
        accountMapper.signUp(username, password);
    }

    @Override
    public int deleteUserById(int id) {
        return accountMapper.deleteUserById(id);
    }


    @Override
    public void save(Account account) {
        accountMapper.save(account);
    }

    @Override
    public List<Account> findAll() {
        return accountMapper.findAll();
    }

    @Override
    public Account findById(int id) {
        return accountMapper.findById(id);
    }

    public List<Account> findByIds(String name) {
        return accountMapper.findByIds(name);
    }

    @Override
    public int deleteById(int id) {
        return accountMapper.deleteById(id);
    }

    @Override
    public int updateAccount(Account account) {
        return accountMapper.updateAccount(account);
    }




}
